<template>
  <p>BBB</p>
  <p>{{ state.num }}</p>
  <button @click="add">add</button>
</template>

<script setup>
// 响应式API
import {
  reactive,
  ref,
  onBeforeMount,
  toRefs,
  toRef,
  onMounted,
  onBeforeUpdate,
  onUpdated,
  onBeforeUnmount,
  onUnmounted,
  watch,
  computed,
  readonly,
  defineProps,
  defineEmit,
} from "vue";

const props = defineProps(["age"]);
console.log(props); // 所有props
const emit = defineEmit(["aaa"]);
emit("aaa"); // 触发自定义事件

const state = reactive({ num: 0 });

const add = () => {
  state.num++;
};
</script>

<style scoped>
</style>
